import { Dropdown } from "antd";
import WinControlTool from '@renderer/components/WinControlTool';
import type { MenuProps } from 'antd';

const filItems: MenuProps['items'] = [
  {
    key: '1',
    label: <div className="w-40 flex justify-between">
      <span>打开文件夹</span>
      <span>CTRL + O</span>
    </div>
  },
  {
    key: '2',
    label: <div className="w-40 flex justify-between">
      <span>保存</span>
      <span>CTRL + S</span>
    </div>,
  },
  {
    type: 'divider',
  },
  {
    key: '3',
    label: <div className="w-40 flex justify-between">
      <span>退出</span>
      <span></span>
    </div>,
  },
];

const editItems: MenuProps['items'] = [
  {
    key: '1',
    label: <div className="w-40 flex justify-between">
      <span>撤销</span>
      <span>CTRL + Z</span>
    </div>,
  },
  {
    key: '2',
    label: <div className="w-40 flex justify-between">
      <span>恢复</span>
      <span>CTRL + Y</span>
    </div>
  },
  {
    type: 'divider',
  },
  {
    key: '3',
    label: <div className="w-40 flex justify-between">
      <span>剪切</span>
      <span>CTRL + X</span>
    </div>,
  },
  {
    key: '4',
    label: <div className="w-40 flex justify-between">
      <span>复制</span>
      <span>CTRL + C</span>
    </div>,
  },
  {
    key: '5',
    label: <div className="w-40 flex justify-between">
      <span>粘贴</span>
      <span>CTRL + V</span>
    </div>,
  },
];

// 头部 可拖动窗口
export default function Header() {
  return <header className="app-region-drag flex justify-between bg-white border-b-black border-b-px px-3 py-2">
    <div className="flex gap-3">
      <Dropdown className="app-region-no-drag" menu={{ items: filItems }} placement="bottom" trigger={['click']}>文件</ Dropdown>
      <Dropdown className="app-region-no-drag" menu={{ items: editItems }} placement="bottom" trigger={['click']}>编辑</ Dropdown>
    </div>
    <WinControlTool />
  </header>
}
